Skip to content

[X86][GlobalIsel] add strictfp attribute from ir into mir #136702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

mahesh-attarde
Copy link
Contributor

I am supporting G_IS_FPCLASS opcode and noticed strictfp attribute was not forwarded into MIFlag.
This patch adds attribute to MIR in GISEL-IRTranslator.
Requirement comes from G_IS_FPCLASS PR mahesh-attarde#4 for strictfp.

@mahesh-attarde mahesh-attarde changed the title [X86][GlobalIsel] add strictfp attribute from ir in mir [X86][GlobalIsel] add strictfp attribute from ir into mir Apr 22, 2025
@@ -630,6 +630,10 @@ uint32_t MachineInstr::copyFlagsFromInstruction(const Instruction &I) {
if (I.getMetadata(LLVMContext::MD_unpredictable))
MIFlags |= MachineInstr::MIFlag::Unpredictable;

if (const CallInst *CI = dyn_cast<CallInst>(&I)) {
MIFlags |=
CI->hasFnAttr(llvm::Attribute::StrictFP) ? MachineInstr::NoFPExcept : 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NoFPExcept is to clear the flag, not to set it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me recheck my use case again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants